#include "models.h"

// 用户类的实现
User::User(int id,
           const QString &username,
           const QString &password,
           const QString &email,
           const QString &phone,
           int age,
           char gender,
           const QString &idNumber,
           int userLevel)
    : id(id)
    , username(username)
    , password(password)
    , email(email)
    , phone(phone)
    , age(age)
    , gender(gender)
    , idNumber(idNumber)
    , userLevel(userLevel)
{}

// 航班类的实现
// 初始化全局航班列表
Flight::Flight(int id,
               const QString &flightNumber,
               const QString &departure,
               const QString &destination,
               const QString &departureAirport,
               const QString &destinationAirport, // 新增参数
               const QDateTime &departureTime,
               const QDateTime &arrivalTime,
               int firstClassSeats,
               int economyClassSeats,
               double firstClassPrice,
               double economyClassPrice,
               const QString &airlineCompany,
               const QString &aircraftModel)
    : id(id)
    , flightNumber(flightNumber)
    , departure(departure)
    , destination(destination)
    , departureAirport(departureAirport)
    , destinationAirport(destinationAirport)
    , // 初始化新字段
    departureTime(departureTime)
    , arrivalTime(arrivalTime)
    , firstClassSeats(firstClassSeats)
    , economyClassSeats(economyClassSeats)
    , firstClassPrice(firstClassPrice)
    , economyClassPrice(economyClassPrice)
    , airlineCompany(airlineCompany)
    , aircraftModel(aircraftModel)
{}

// 订单类的实现
Order::Order(int id,
             int userId,
             int flightId,
             const QString &seatType,
             int price,
             const QString &orderStatus,
             const QDateTime &paymentTime,
             const QDateTime &refundTime,
             const QDateTime &createdAt)
    : id(id)
    , userId(userId)
    , flightId(flightId)
    , seatType(seatType)
    , price(price)
    , orderStatus(orderStatus)
    , paymentTime(paymentTime)
    , refundTime(refundTime)
    , createdAt(createdAt)
{}
